package learning.logging;

public class Log {

	public enum Level { COARSE, FINE };
	
	private static Logger logger;
	private static Level level = Level.COARSE;
	
	public static void setLogger(Logger logger) {
		Log.logger = logger;
	}
		
	public static void setLevel(Level level) {
		Log.level = level;
	}

	public static void log(String msg, Level level) {
		if (level.equals(Log.level) && logger != null)
			logger.print(msg);
	}
	
	public static Logger getLogger() {
		return logger;
	}
	
	public static Level getLevel() {
		return level;
	}
}
